perm filename DMC.FUN[CLS,LSP] blob sn#832105 filedate 1987-01-12 generic text, type T, neo UTF8
Information to go into the Function chapter, not yet formatted
according to the schema for function descriptions

%The EXAMPLES field of each of the auxiliary m-c functions
%should cross-reference the examples in define-methpd-combination.


% MAKE-METHOD-CALL method-list &key :operator :around :identity-with-one-argument  [function]

\Defun {make-method-call} {method-list {\key :operator :around :identity-with-one-argument}}

Returns a form whose car is {\it operator\/}
(default is {\bf progn}) and whose cdr is
a list of forms that call the methods.  Each method receives the same
arguments that the generic function received.
{\bf make-method-call} hides the implementation-dependent details of how
methods are called.

{\bf make-method-call} can be called only 
from the dynamic environment of a method-combination function,
that is, from the body of {\bf define-method-combination},
from a {\bf compute-effective-method} method,
or from a function called by one of them.

Each element of {\it method-list\/} can be either a method-object or a
list.  When a list is given, it is regarded as a form and converted when
necessary into a method whose body is that form (conceptually by enclosing
it in a {\bf lambda}-expression).

If {\bf :around} is true and the length of {\it method-list\/} is 
greater than 1, the result is a form that calls the first method and
arranges for {\bf call-next-method} to reach the rest of the methods, in the
order they appear in {\it method-list\/}.
If {\bf :around} is true {\bf :operator} must not be specified.
By default, {\bf :around} is false. 

If {\bf :identity-with-one-argument} is true and
{\it method-list\/} contains exactly one
element, the result is simply a form that calls that single method, with no
invocation of the operator.
If {\bf :operator} is {\bf progn}, the default for 
{\bf :identity-with-one-argument} is true;
otherwise the default for this option is false.
Use this option with such operators as {\bf progn}, {\bf and}, {\bf $+$},
and {\bf max} that are identity operators when applied to one argument.
This optimization can enable the use of an existing method as the
effective method, avoiding the need to create a new effective method.
The object system's optimizer already knows about {\bf progn}, 
{\bf multiple-value-prog1}, and {\bf multiple-value-prog2},
but {\bf :identity-with-one-argument} can be used to tell it
about other operators.

If {\it method-list\/} is {\bf nil}, the result is a call to
{\it operator\/} with no arguments, or a form with the same effect.

As a convenience, if {\it method-list\/} is a method-object, it is
automatically converted to a one-element list of that method.

\label Possible extensions:

Additional keyword arguments will be if call-next-method is allowed
to change the arguments passed on to the next method.  They will
be proposed separately.


METHOD-QUALIFIERS method                                        [function]

Returns a list of the method's qualifiers.  This is particularly useful
when the body forms perform additional filtering or processing of the
method-group lists.  For example: 

     (setq methods (remove-duplicates methods
                                      :from-end t
                                      :key #'method-qualifiers
                                      :test #'equal))


MULTIPLE-VALUE-PROG2 form result-form {form}*                   [macro]

The obvious extension of MULTIPLE-VALUE-PROG1.   It 
evaluates the forms and returns all the values of the result-form. 


METHOD-COMBINATION-ERROR format-string &rest args		[function]

Reports a problem in method combination, using
{\it format-string\/} and {\it args\/} to construct the
error message.  An implementation may add additional contextual
information to the error message, thus {\bf method-combination-error}
should be called only  
from the dynamic environment of a method-combination function.

The environment determines whether {\bf method-combination-error}
returns to its caller or throws.

{\bf method-combination-error} will use the condition signalling system
when and if it is adopted into Common Lisp.


INVALID-METHOD-ERROR method format-string &rest args		[function]

Reports an available method whose qualifiers are not valid for
the method combination type, using
{\it format-string\/} and {\it args\/} to construct the
error message.  An implementation may add additional contextual
information to the error message, thus {\bf invalid-method-error}
should be called only  
from the dynamic environment of a method-combination function.

{\it method\/} is the invalid method. 

{\bf invalid-method-error} is called automatically when a method fails to
satisfy every qualifier-pattern and predicate
in a {\bf define-method-combination}.  A method combination
function that imposes additional restrictions should call
{\bf invalid-method-error} explicitly if it encounters
a method it cannot accept.

The environment determines whether {\bf invalid-method-error}
returns to its caller or throws.

{\bf invalid-method-error} will use the condition signalling system when
and if it is adopted into Common Lisp.